/*     */ package com.lmpop.createIndex.search;
/*     */ 
/*     */ import com.lmpop.createIndex.searchModel.SearchData;
/*     */ import com.lmpop.createIndex.searchModel.SearchModel;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintStream;
/*     */ import java.util.ArrayList;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class CommparaIndexFiles
/*     */ {
/*     */   public ProperUtil properUtil;
/*     */   private String file_path;
/*     */ 
/*     */   public CommparaIndexFiles()
/*     */   {
/*  20 */     this.properUtil = new ProperUtil();
/*  21 */     this.file_path = this.properUtil.getFilePathByModel("commpara");
/*     */   }
/*     */ 
/*     */   public List getCommparaInfo(Map paraMap) throws IOException {
/*  25 */     ArrayList showList = new ArrayList();
/*  26 */     SearchData search = new SearchData();
/*  27 */     ArrayList paraList = new ArrayList();
/*     */ 
/*  29 */     String param_name = ""; String para_code1 = ""; String param_attr = ""; String para_code2 = ""; String param_code = ""; String para_code3 = ""; String para_code4 = ""; String subsys_code = "";
/*  30 */     if (paraMap.get("param_name") != null) param_name = paraMap.get("param_name").toString();
/*  31 */     if (paraMap.get("para_code1") != null) para_code1 = paraMap.get("para_code1").toString();
/*  32 */     if (paraMap.get("param_attr") != null) param_attr = paraMap.get("param_attr").toString();
/*  33 */     if (paraMap.get("para_code2") != null) para_code2 = paraMap.get("para_code2").toString();
/*  34 */     if (paraMap.get("para_code3") != null) para_code3 = paraMap.get("para_code3").toString();
/*  35 */     if (paraMap.get("param_code") != null) param_code = paraMap.get("param_code").toString();
/*  36 */     if (paraMap.get("para_code4") != null) para_code4 = paraMap.get("para_code4").toString();
/*  37 */     if (paraMap.get("subsys_code") != null) subsys_code = paraMap.get("subsys_code").toString();
/*     */ 
/*  40 */     paraList.add(new SearchModel("0", "param_name", param_name));
/*  41 */     paraList.add(new SearchModel("0", "para_code1", para_code1));
/*  42 */     paraList.add(new SearchModel("0", "param_attr", param_attr));
/*  43 */     paraList.add(new SearchModel("0", "para_code2", para_code2));
/*  44 */     paraList.add(new SearchModel("0", "para_code3", para_code3));
/*  45 */     paraList.add(new SearchModel("0", "param_code", param_code));
/*  46 */     paraList.add(new SearchModel("0", "para_code4", para_code4));
/*  47 */     paraList.add(new SearchModel("0", "subsys_code", subsys_code));
/*     */ 
/*  49 */     showList = search.getSearchInfo(this.file_path, paraList);
/*  50 */     return showList;
/*     */   }
/*     */ 
/*     */   public String getSelectItemByID(String param_attr, String paraKey, String paraValue)
/*     */   {
/*  56 */     Map comm = new Hashtable();
/*  57 */     comm.put("param_attr", param_attr);
/*  58 */     String selectItems = "";
/*     */     try {
/*  60 */       List list = getCommparaInfo(comm);
/*     */ 
/*  62 */       Map objMap = new Hashtable();
/*  63 */       String sKey = "";
/*  64 */       String sValue = "";
/*  65 */       if ((list != null) && (list.size() > 0))
/*  66 */         for (int i = 0; i < list.size(); i++) {
/*  67 */           objMap = (Hashtable)list.get(i);
/*  68 */           if (objMap.get(paraKey) != null) {
/*  69 */             sKey = objMap.get(paraKey).toString();
/*     */           }
/*  71 */           if (objMap.get(paraValue) != null) {
/*  72 */             sValue = objMap.get(paraValue).toString();
/*     */           }
/*  74 */           if (sKey.equals("")) {
/*  75 */             sKey = "0";
/*  76 */             selectItems = selectItems + "<option  value=" + sKey + ">" + sValue + "</option>";
/*     */           } else {
/*  78 */             selectItems = selectItems + "<option value=" + sKey + ">" + sValue + "</option>";
/*     */           }
/*     */         }
/*     */     }
/*     */     catch (Exception e) {
/*  83 */       System.out.println("Error Here : " + e.getMessage());
/*     */     }
/*     */ 
/*  86 */     return selectItems;
/*     */   }
/*     */ 
/*     */   public String getComparaNameByID(String param_attr, String paraKey, String paraValue, String paraTarget)
/*     */   {
/*  93 */     Map comm = new Hashtable();
/*  94 */     comm.put("param_attr", param_attr);
/*  95 */     comm.put(paraKey, paraValue);
/*  96 */     String result = "";
/*     */     try {
/*  98 */       List list = getCommparaInfo(comm);
/*     */ 
/* 100 */       Map objMap = new Hashtable();
/* 101 */       if ((list != null) && (list.size() > 0))
/*     */       {
/* 103 */         objMap = (Hashtable)list.get(0);
/* 104 */         if (objMap.get(paraTarget) != null)
/* 105 */           result = objMap.get(paraTarget).toString();
/*     */       }
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 110 */       System.out.println("Error Here : " + e.getMessage());
/*     */     }
/*     */ 
/* 113 */     return result;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.createIndex.search.CommparaIndexFiles
 * JD-Core Version:    0.6.0
 */